#pragma once

#include "glare.core.Prerequisites.h"
#include "glare.core.Factory.h"
#include "glare.core.DriverStage.h"
#include "glare.core.Log.h"

namespace Glare {

	class Driver
	{
	public : Driver();
	public : virtual ~Driver() {}

	public : virtual RenderWindow* CreateRenderWindow(PlatformWindow* platform_window) = 0;
	public : virtual void DestroyRenderWindow(RenderWindow* render_window) = 0;

	public : virtual GpuResourceFactory* GetGpuResourceFactory() const = 0;
	public : virtual ShaderFactory* GetShaderFactory() const = 0;
	public : virtual DrawStateFactory* GetDrawStateFactory() const = 0;

	public : virtual DrawContext* GetImmediateDrawContext() const = 0;

	public : virtual DrawContext* CreateDrawContext() = 0;
	public : virtual void DestroyDrawContext(DrawContext* draw_context) = 0;

	public : virtual std::string& GetName() const = 0;

	public : virtual const DriverStage::Type GetSupportedStages() const = 0;
	public : const bool IsPipelineStageSupported(const DriverStage::Type& stage_type) const;

	public : virtual const DriverCapabilities& GetCapabilities() const = 0;

	public : void SetLog(Log* log);
	public : Log* GetLog() const;

	public : void WriteLog(const string& message, const LogMessageType& message_type);

	private : Log* _log;
	};

	typedef Factory<Driver> DriverFactory;

}
